﻿@inherits LayoutComponentBase

<Layout SideWidth="0" IsPage="true" IsFullSide="true" IsFixedHeader="true"
        ShowFooter="true" ShowGotoTop="true" ShowCollapseBar="true" Menus="@MenuItems"
        OnAuthorizing="@OnAuthorizing" OnErrorHandleAsync="OnErrorHandleAsync"
        UseTabSet="true" TabDefaultUrl="/Admin/Index" OnUpdateAsync="OnUpdateAsync">
    <Header>
        <span class="ms-3 flex-fill">Bootstrap of Blazor</span>
        <Logout ImageUrl="@Icon" DisplayName="@Context.DisplayName" UserName="@UserName">
            <LinkTemplate>
                <a href="/Admin/Profiles"><i class="fa fa-suitcase"></i>个人中心</a>
                <a href="/Admin/Index"><i class="fa fa-cog"></i>设置</a>
                <a href="/Admin/Notifications"><i class="fa fa-bell"></i>通知<span id="logoutNoti" class="badge badge-pill badge-success"></span></a>
                <LogoutLink />
            </LinkTemplate>
        </Logout>
        <div class="layout-drawer"><i class="fa fa-gears"></i></div>
    </Header>
    <Side>
        <div class="layout-banner">
            <img class="layout-logo" src="/images/brand.png" />
            <div class="layout-title">
                <span>@Title</span>
            </div>
        </div>
        <div class="layout-user">
            <img class="layout-avatar" src="@Icon">
            <div class="layout-title">
                <span>@Context.DisplayName</span>
            </div>
            <div class="layout-user-state"></div>
        </div>
    </Side>
    <Main>
        @Body
    </Main>
    <Footer>
        <div class="flex-fill text-center text-dark">@Footer</div>
    </Footer>
    <NotAuthorized>
        <Redirect />
    </NotAuthorized>
</Layout>

@if (Lock)
{
    <AutoRedirect LogoutUrl="/Account/Logout" Interval="@LockInterval"></AutoRedirect>
}
